Equivalent of running $_SERVER['DOCUMENT_ROOT'] when running php in terminal

Posted by Matt on Stack Overflow See other posts from Stack Overflow or by Matt
Published on 2010-04-29T07:12:47Z Indexed on 2010/04/29 7:17 UTC
Read the original article Hit count: 449

Filed under:
|
|

Hey all,

I was wondering if there is some variable that will return what $_SERVER['DOCUMENT_ROOT'] returns when I call PHP like this: ./somescript

If not, how do people get around this case? I'm looking to be able to call the same script (a template compiler) in both the web browser and the terminal.

Thanks! Matt Mueller

© Stack Overflow or respective owner

Related posts about php

Related posts about root